<template>
    <div class="container">
        <van-nav-bar title="本机投递记录" left-arrow  @click-left="onClickLeft"/>
        <div class="content">
            <template 
                v-for="item in EquipmentDeliveryList"
                :key="item.recordId"
            >
                <div class="item">
                    <div class="title">{{ item.deviceAddress }}</div>
                    <div class="text">投递时间：{{ item.deliveryTime }}</div>
                    <div class="text">投递重量：{{ item.weight }}kg</div>
                </div>
            </template>
        </div>
    </div>
</template>

<script setup>
import { useRoute,useRouter } from 'vue-router';
import { 
    goLookEquipmentDelivery
} from '@/api/DeviceManage';
import { onMounted, ref } from 'vue';
const route = useRoute()
const router = useRouter()
const onClickLeft = () => { //点击返回
    router.push({
        path:'/ClearReport',
        query:{
            id:route.query.id
        }
    })
}

let EquipmentDeliveryList = ref([])
const goLookEquipmentDeliveryFun = async () => { //调投递记录
    let goLookEquipmentDeliveryData = {
        code:route.query.code
    }
    try{
        const res = await goLookEquipmentDelivery(goLookEquipmentDeliveryData)
        EquipmentDeliveryList.value = res.data.dataset.list
        // console.log(EquipmentDeliveryList.value);
    }catch(error){}
}

onMounted(() => {
    goLookEquipmentDeliveryFun()
})
</script>

<style lang="less" scoped>
.container{
    // height:100vh;
    background-color: #F9F9F9;
    :deep(.van-nav-bar .van-icon){
        color:#000
    }
    .content{
        box-sizing: border-box;
        padding:1em 1em 0 1em;
        font-size: 4em;
        display: flex;
        flex-direction: column;
        gap:1em;
        .item{
            box-sizing: border-box;
            padding:1em 0;
            background-color: #fff;
            display: flex;
            flex-direction: column;
            gap:1em;
            border-radius: 1em;
            .title{
                border-left: 4px solid #FF8000;
                box-sizing: border-box;
                padding-left:1em;
                font-weight: bold;
            }
            .text{
                box-sizing: border-box;
                padding-left:1.2em;
            }
        }
    }
}
</style>